<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Earthworm toxicity test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for earthworms"><tr><td>earthworms</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Earthworm toxicity test</h2>

<h3>Description</h3>

<p>The dataset was obtained from a toxicity test using earthworms, and it contains the number of earthworms 
remaining in a container that was contaminated with a toxic substance (not disclosed) at various doses; so the number of earthworms not migrating to the neighbouring uncontaminated container.
</p>


<h3>Usage</h3>

<pre>data(earthworms)</pre>


<h3>Format</h3>

<p>A data frame with 35 observations on the following 3 variables.
</p>

<dl>
<dt><code>dose</code></dt><dd><p>a numeric vector of dose values</p>
</dd>
<dt><code>number</code></dt><dd><p>a numeric vector containing counts of remaining earthworms in the container</p>
</dd>
<dt><code>total</code></dt><dd><p>a numeric vector containing total number of earthworms put in the containers</p>
</dd>
</dl>



<h3>Details</h3>

<p>At dose 0 around half of the earthworms is expected be in each of the two containers. Thus it is not 
appropriate to fit an ordinary logistic regression with log(dose) as explanatory variable to these data
as it implies an upper limit of 1 at dose 0 and in fact this model does not utilise the observations
at dose 0 (see the example section below). 
</p>


<h3>Source</h3>

<p>The dataset is kindly provided by Nina Cedergreen, Faculty of Life Sciences, University of Copenhagen, 
Denmark.
</p>


<h3>Examples</h3>

<pre>

## Fitting a logistic regression model
earthworms.m1 &lt;- drm(number/total~dose, weights = total, data = earthworms,
fct = LL.2(), type = "binomial")
modelFit(earthworms.m1)  # a crude goodness-of-fit test

## Fitting an extended logistic regression model 
##  where the upper limit is estimated
earthworms.m2 &lt;- drm(number/total~dose, weights = total, data = earthworms,
fct = LL.3(), type = "binomial")
modelFit(earthworms.m2)  # goodness-of-fit test
# improvement not visible in test!!!

## Comparing model1 and model2 
## (Can the first model be reduced to the second model?)
anova(earthworms.m1, earthworms.m2)

</pre>


</body></html>
